/**
 * Source file: TelChecker.ejs
 * Copyright (C) 2013 : Quantum Solutions
 * Id: $Id: Funtion_TelChecker.ejs 85 2013-04-21 22:35:52Z WillieVisagie55@gmail.com $
 * Date: $Date: 2013-04-21 22:35:52 +0000 (Sun, 21 Apr 2013) $
 */

function TelNoValidater(Telno) {
	if (Telno.length == 0){
		return true;
	} else if (Telno.length != 10){
		alert('Telephone Number should be 10 digits long, but is '+Telno.length);
		return false;
	} else if (Telno.charAt(0) != "0") {
		alert('Telephone should start with 0');
		return false;
	}  else {
		pieces = Telno.split("");
		for (x=0;x<Telno.length;x++) {
			if (isNaN(pieces[x])) {
				alert('Telephone should only contain numeric digits');
				return false;
			}
		}
	}

	//alert('ok');
	return true;
}